﻿namespace Example.Structural
{
    using Example.Structural.Decorator;

    using Xunit;

    /// <summary>
    /// Attach additional responsibilities to an object dynamically keeping the same interface.
    /// Decorators provide a flexible alternative to subclassing for extending functionality.
    /// </summary>
    public sealed class DecoratorFacts
    {
        private static readonly Song _song = new Song("lyrics");

        [Fact]
        public void mp3_recording()
        {
            var obj = new Mp3(_song, "singer");

            Assert.Equal("lyrics (singer)", obj.Recording);
        }

        [Fact]
        public void tape_recording()
        {
            var obj = new Tape(_song, "label");

            Assert.Equal("lyrics", obj.Recording);
        }
    }
}